from jenkinsapi import jenkins


class JenkinsApi(object):
    def __init__(self):
        jenkins_info = {"baseurl": "http://192.168.64.137:8080/",
                        "username": "admin",
                        "password": "llz9033..."}
        self.jk = jenkins.Jenkins(**jenkins_info, use_crumb=True)
        # jenkins.Jenkins(baseurl=baseurl, username=username, password=password, use_crumb=True)
        ...

    def get_all_jobs(self):
        return self.jk.keys()

    def get_qiankun_jobs(self):

        return self.jk.get_queue().keys()



if __name__ == '__main__':
    jenkins_api = JenkinsApi()
    print(jenkins_api.get_qiankun_jobs())
